package com.cmbc.practice;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 2.spring静态工厂创建bean
 *
 */
public class App2 
{
    public static void main( String[] args )
    {
        ApplicationContext context=new ClassPathXmlApplicationContext("META-INF/person-factory.xml");
        Chinese c=(Chinese) context.getBean("chinese");
        c.say();
        System.out.println(c.getNationality());
        American a=(American) context.getBean("american");
        a.say();
        System.out.println(a.getNationality());
    }
}
